package com.health.platform.common.utils;

import com.health.platform.common.sys.login.entity.UserEntity;

/**
 * <p>登录ThreadLocal</p>
 * <p>创建日期：2021-02-08</p>
 *
 * @author zhou-qf
 */
public class ThreadLocalUtil {

    private static final ThreadLocal<UserEntity> THREAD_LOCAL_VALUE = new ThreadLocal<>();

    public static void set(UserEntity userEntity){
        THREAD_LOCAL_VALUE.set(userEntity);
    }

    public static UserEntity get(){
        return THREAD_LOCAL_VALUE.get();
    }

    public static void remove(){
        THREAD_LOCAL_VALUE.remove();
    }
}
